// Statement.cpp: implementation of the Statement class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "Expression.h"
#include "Statement.h"
#include "ExpressionStmt.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

Statement::Statement()
{

}

Statement::~Statement()
{

}

BOOL Statement::Interpret()
{
	ComplierNote* pNote = new ExpressionStmt;
	pNote->SetOwner(this);
	LeftNote(pNote);
	if(!pNote->Interpret())
	{
		this->ErrorInfo(pNote->ErrorInfo());
		return FALSE;
	}
	return TRUE;
}

Variable Statement::Execute()
{
	return LeftNote()->Execute();
}